package com.zj.fx.model.rpa;

import cn.hutool.core.util.StrUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * RPA抓取供电可靠率数据表 RpaFetchreliabilityExample
 * @author SQL_自动生成
 * @date 2023-10-10 16:21:34
 */
public class RpaFetchreliabilityExample {

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public RpaFetchreliabilityExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        
            public Criteria andIdIsNull() {
                addCriterion("id is null");
                return (Criteria) this;
            }

            public Criteria andIdIsNotNull() {
                addCriterion("id is not null");
                return (Criteria) this;
            }

            public Criteria andIdEqualTo(String value) {
                addCriterion("id =", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotEqualTo(String value) {
                addCriterion("id <>", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdGreaterThan(String value) {
                addCriterion("id >", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdGreaterThanOrEqualTo(String value) {
                addCriterion("id >=", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLessThan(String value) {
                addCriterion("id <", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLessThanOrEqualTo(String value) {
                addCriterion("id <=", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLike(String value) {
                addCriterion("id like", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotLike(String value) {
                addCriterion("id not like", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdIn(List<String> values) {
                addCriterion("id in", values, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotIn(List<String> values) {
                addCriterion("id not in", values, "id");
                return (Criteria) this;
            }

            public Criteria andIdBetween(String value1, String value2) {
                addCriterion("id between", value1, value2, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotBetween(String value1, String value2) {
                addCriterion("id not between", value1, value2, "id");
                return (Criteria) this;
            }

        
            public Criteria andTaskmonthIsNull() {
                addCriterion("taskmonth is null");
                return (Criteria) this;
            }

            public Criteria andTaskmonthIsNotNull() {
                addCriterion("taskmonth is not null");
                return (Criteria) this;
            }

            public Criteria andTaskmonthEqualTo(String value) {
                addCriterion("taskmonth =", value, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthNotEqualTo(String value) {
                addCriterion("taskmonth <>", value, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthGreaterThan(String value) {
                addCriterion("taskmonth >", value, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthGreaterThanOrEqualTo(String value) {
                addCriterion("taskmonth >=", value, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthLessThan(String value) {
                addCriterion("taskmonth <", value, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthLessThanOrEqualTo(String value) {
                addCriterion("taskmonth <=", value, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthLike(String value) {
                addCriterion("taskmonth like", value, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthNotLike(String value) {
                addCriterion("taskmonth not like", value, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthIn(List<String> values) {
                addCriterion("taskmonth in", values, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthNotIn(List<String> values) {
                addCriterion("taskmonth not in", values, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthBetween(String value1, String value2) {
                addCriterion("taskmonth between", value1, value2, "taskmonth");
                return (Criteria) this;
            }

            public Criteria andTaskmonthNotBetween(String value1, String value2) {
                addCriterion("taskmonth not between", value1, value2, "taskmonth");
                return (Criteria) this;
            }

        
            public Criteria andSubcompanynameIsNull() {
                addCriterion("subcompanyname is null");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameIsNotNull() {
                addCriterion("subcompanyname is not null");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameEqualTo(String value) {
                addCriterion("subcompanyname =", value, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameNotEqualTo(String value) {
                addCriterion("subcompanyname <>", value, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameGreaterThan(String value) {
                addCriterion("subcompanyname >", value, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameGreaterThanOrEqualTo(String value) {
                addCriterion("subcompanyname >=", value, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameLessThan(String value) {
                addCriterion("subcompanyname <", value, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameLessThanOrEqualTo(String value) {
                addCriterion("subcompanyname <=", value, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameLike(String value) {
                addCriterion("subcompanyname like", value, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameNotLike(String value) {
                addCriterion("subcompanyname not like", value, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameIn(List<String> values) {
                addCriterion("subcompanyname in", values, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameNotIn(List<String> values) {
                addCriterion("subcompanyname not in", values, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameBetween(String value1, String value2) {
                addCriterion("subcompanyname between", value1, value2, "subcompanyname");
                return (Criteria) this;
            }

            public Criteria andSubcompanynameNotBetween(String value1, String value2) {
                addCriterion("subcompanyname not between", value1, value2, "subcompanyname");
                return (Criteria) this;
            }

        
            public Criteria andSupplynameIsNull() {
                addCriterion("supplyname is null");
                return (Criteria) this;
            }

            public Criteria andSupplynameIsNotNull() {
                addCriterion("supplyname is not null");
                return (Criteria) this;
            }

            public Criteria andSupplynameEqualTo(String value) {
                addCriterion("supplyname =", value, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameNotEqualTo(String value) {
                addCriterion("supplyname <>", value, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameGreaterThan(String value) {
                addCriterion("supplyname >", value, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameGreaterThanOrEqualTo(String value) {
                addCriterion("supplyname >=", value, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameLessThan(String value) {
                addCriterion("supplyname <", value, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameLessThanOrEqualTo(String value) {
                addCriterion("supplyname <=", value, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameLike(String value) {
                addCriterion("supplyname like", value, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameNotLike(String value) {
                addCriterion("supplyname not like", value, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameIn(List<String> values) {
                addCriterion("supplyname in", values, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameNotIn(List<String> values) {
                addCriterion("supplyname not in", values, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameBetween(String value1, String value2) {
                addCriterion("supplyname between", value1, value2, "supplyname");
                return (Criteria) this;
            }

            public Criteria andSupplynameNotBetween(String value1, String value2) {
                addCriterion("supplyname not between", value1, value2, "supplyname");
                return (Criteria) this;
            }

        
            public Criteria andRateIsNull() {
                addCriterion("rate is null");
                return (Criteria) this;
            }

            public Criteria andRateIsNotNull() {
                addCriterion("rate is not null");
                return (Criteria) this;
            }

            public Criteria andRateEqualTo(String value) {
                addCriterion("rate =", value, "rate");
                return (Criteria) this;
            }

            public Criteria andRateNotEqualTo(String value) {
                addCriterion("rate <>", value, "rate");
                return (Criteria) this;
            }

            public Criteria andRateGreaterThan(String value) {
                addCriterion("rate >", value, "rate");
                return (Criteria) this;
            }

            public Criteria andRateGreaterThanOrEqualTo(String value) {
                addCriterion("rate >=", value, "rate");
                return (Criteria) this;
            }

            public Criteria andRateLessThan(String value) {
                addCriterion("rate <", value, "rate");
                return (Criteria) this;
            }

            public Criteria andRateLessThanOrEqualTo(String value) {
                addCriterion("rate <=", value, "rate");
                return (Criteria) this;
            }

            public Criteria andRateLike(String value) {
                addCriterion("rate like", value, "rate");
                return (Criteria) this;
            }

            public Criteria andRateNotLike(String value) {
                addCriterion("rate not like", value, "rate");
                return (Criteria) this;
            }

            public Criteria andRateIn(List<String> values) {
                addCriterion("rate in", values, "rate");
                return (Criteria) this;
            }

            public Criteria andRateNotIn(List<String> values) {
                addCriterion("rate not in", values, "rate");
                return (Criteria) this;
            }

            public Criteria andRateBetween(String value1, String value2) {
                addCriterion("rate between", value1, value2, "rate");
                return (Criteria) this;
            }

            public Criteria andRateNotBetween(String value1, String value2) {
                addCriterion("rate not between", value1, value2, "rate");
                return (Criteria) this;
            }

        
        public Criteria andLikeQuery(RpaFetchreliability record) {
            List<String> list = new ArrayList<String>();
            List<String> list2 = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
                            if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                    list.add("ifnull(id,'')");
                }
                            if (record.getTaskmonth() != null && StrUtil.isNotEmpty(record.getTaskmonth().toString())) {
                    list.add("ifnull(taskmonth,'')");
                }
                            if (record.getSubcompanyname() != null && StrUtil.isNotEmpty(record.getSubcompanyname().toString())) {
                    list.add("ifnull(subcompanyname,'')");
                }
                            if (record.getSupplyname() != null && StrUtil.isNotEmpty(record.getSupplyname().toString())) {
                    list.add("ifnull(supplyname,'')");
                }
                            if (record.getRate() != null && StrUtil.isNotEmpty(record.getRate().toString())) {
                    list.add("ifnull(rate,'')");
                }
                                        if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                    list2.add("'%" + record.getId() + "%'");
                }
                            if (record.getTaskmonth() != null && StrUtil.isNotEmpty(record.getTaskmonth().toString())) {
                    list2.add("'%" + record.getTaskmonth() + "%'");
                }
                            if (record.getSubcompanyname() != null && StrUtil.isNotEmpty(record.getSubcompanyname().toString())) {
                    list2.add("'%" + record.getSubcompanyname() + "%'");
                }
                            if (record.getSupplyname() != null && StrUtil.isNotEmpty(record.getSupplyname().toString())) {
                    list2.add("'%" + record.getSupplyname() + "%'");
                }
                            if (record.getRate() != null && StrUtil.isNotEmpty(record.getRate().toString())) {
                    list2.add("'%" + record.getRate() + "%'");
                }
                        buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append(" like CONCAT(");
            buffer.append(StrUtil.join(",", list2));
            buffer.append(")");
            if (!" CONCAT() like CONCAT()".equals(buffer.toString())) {
                addCriterion(buffer.toString());
            }
            return (Criteria) this;
        }

        public Criteria andLikeQuery2(String searchText) {
            List<String> list = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
                            list.add("ifnull(id,'')");
                            list.add("ifnull(taskmonth,'')");
                            list.add("ifnull(subcompanyname,'')");
                            list.add("ifnull(supplyname,'')");
                            list.add("ifnull(rate,'')");
                        buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append("like '%");
            buffer.append(searchText);
            buffer.append("%'");
            addCriterion(buffer.toString());
            return (Criteria) this;
        }

    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}